@import '@/style/imports';

$banner-height: 570px !default;

$height-percent: 82%;

.page-distribution-shop-home {
  width: 100%;
  padding-bottom: $tabbar-height;
  /*  #ifdef  h5  */
  /*  #endif  */
  .shop-banner {
    width: 100%;
    position: relative;
    height: $banner-height;
    background: #fff;
    box-sizing: border-box;
    .shop-def {
      width: 100%;
      height: $height-percent;
      position: relative;
      left: 0;
      top: 0;
      background: #efefef;
      .banner-img {
        width: 100%;
        height: 100%;
        display: block;
      }
    }
    .shop-info {
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: absolute;
      width: 95%;
      left: 50%;
      top: $height-percent;
      padding: 20px 30px;
      height: 160px;
      z-index: 99;
      border-radius: 30px;
      box-sizing: border-box;
      transform: translate(-50%, -50%);
      background: #fff;
      box-shadow: 0px 12px 20px 0px rgba(0, 0, 0, 0.1);
      .left {
        flex: 1;
        display: flex;
        align-items: center;
        overflow: hidden;
      }
      .right {
        margin-left: 10px;
        .share {
          width: 170px;
          padding: 0 !important;
          background: initial;
          border: none;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 24px;
          color: inherit;
          color: #fff;
          height: 60px;
          border-radius: 10px;
          background: #d92128;
          .text {
            font-size: 24px;
            margin-left: 10px;
          }
          &::after {
            display: none;
          }
        }
      }
      .shopkeeper-avatar {
        margin-right: 20px;
        width: 80px;
        height: 80px;
        border-radius: 100%;
        border: 2px solid #ebebeb;
      }
      .shop-name-goods {
        font-size: 32px;
        flex: 1;
        overflow: hidden;
        .names {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        .num {
          font-size: 40px;
          color: #ff6918;
          font-weight: bold;
        }
        .text {
          display: inline-block;
          font-size: 24px;
          color: #888;
          font-weight: normal;
        }
      }
      .shop-desc {
        color: #999;
      }
    }
    .shop-setting {
      display: flex;
      align-items: center;
      position: absolute;
      right: 30px;
      top: 50%;
      padding: 0 10px 0 15px;
      transform: translateY(-50%);
      border-radius: 30px;
      border: 1px solid #fff;
      background: rgba(255, 255, 255, 0.6);
      color: #666;
    }
  }
  .filter {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 9;
    background: #fff;
    border-bottom: 4px solid #efefee;
    .filterMain {
      width: 100%;
      position: relative;
      display: flex;
      box-sizing: border-box;
      // padding: 6px 240px 10px 30px;
      padding: 6px 30px 10px 30px;
      align-items: flex-end;
      justify-content: space-around;
      .at-search-bar {
        flex: 1;
      }
      .at-search-bar__clear {
        display: none !important;
      }
      .filterItem {
        padding: 5px 10px;
        display: flex;
        align-items: center;
        position: relative;
        transition: color 0.3s;
        border: 10px solid transparent;
        font-size: 30px;
        color: #666;
        // &::after {
        //   width: 0px;
        //   content: '';
        //   position: absolute;
        //   left: 50%;
        //   bottom: 0;
        //   transform: translateX(-50%);
        //   transition: width 0.3s;
        //   border-bottom: 4px solid #fff;
        // }
        .sort {
          position: relative;
          margin-left: 10px;
          &::before,
          &::after {
            @include arrow(5px);
            position: absolute;
            transition: border 0.5s;
          }
          &::before {
            // up
            transform: translateY(-100%) rotate(-135deg);
          }
          &::after {
            // down
            transform: translateY(20%) rotate(45deg);
          }
        }
        &.active {
          color: #d92128;
          // &::after {
          //   width: 100%;
          //   border-color: #d9011b !important;
          // }
          .sort {
            border-color: #d92128;
            &.up:before {
              border-color: initial;
            }
            &.down:after {
              border-color: initial;
            }
          }
        }
      }
      .searchContent {
        width: 210px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 30px;
        border: 2px solid #ddd;
        background: #fff;
        height: 60px;
        transition: all 0.3s;
        position: absolute;
        top: 50%;
        right: 30px;
        transform: translateY(-50%);
        .icon-search {
          font-size: 40px;
          padding: 15px 10px;
          color: #999;
          display: flex;
          align-items: center;
          justify-content: center;
          overflow: hidden;
          .txt {
            font-size: 24px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }
        .inputContent {
          width: calc(100% - 60px);
          height: 100%;
          display: flex;
          position: absolute;
          left: 55px;
          flex: 1;
          align-items: center;
          .keywords {
            flex: 1;
          }
          .at-icon-close-circle {
            color: #999;
            display: none;
            border: 10px solid transparent;
            &.show {
              display: block;
            }
          }
        }
        &.unfold {
          width: calc(100% - 60px);
          justify-content: flex-start;
          z-index: 9;
          .txt {
            display: none;
          }
        }
      }
    }
  }
  .main {
    width: 100%;
    padding: 10px;
    display: flex;
    box-sizing: border-box;
    flex-wrap: wrap;
    overflow: hidden;
    background: #f5f5f5;
    min-height: calc(100vh - #{$banner-height} - #{2 * $tabbar-height});
    /*  #ifdef  h5  */
    height: calc(100vh - #{$banner-height} - #{2 * $tabbar-height} - $navigate-height-h5);
    /*  #endif  */
    .goodItem {
      flex-shrink: 0;
      width: 50%;
      height: 530px;
      padding: 10px;
      box-sizing: border-box;
      margin-bottom: 10px;
      overflow: hidden;
      .content {
        width: 100%;
        height: 100%;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 4px 4px 8px 0px #b4b4b4;
        background: #fff;
        .imgContent {
          width: 100%;
          height: 340px;
          position: relative;
          .goodImg {
            width: 100%;
            height: 100%;
          }
          .outSale {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            visibility: hidden;
            background: rgba(255, 255, 255, 0.2);
            &::after {
              content: '已售罄';
              position: absolute;
              width: 60%;
              height: 60%;
              top: 50%;
              left: 50%;
              color: #fff;
              font-weight: bold;
              background: rgba(0, 0, 0, 0.6);
              border-radius: 100%;
              display: flex;
              align-items: center;
              justify-content: center;
              transform: translate(-50%, -50%);
            }
          }
        }
        .info {
          // width: 100%;
          height: calc(100% - 340px);
          padding: 10px 20px 0px 20px;
          overflow: hidden;
          display: flex;
          flex-direction: column;
          // justify-content: space-between;
          .goodName {
            width: 100%;
            font-size: 24px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            /* autoprefixer: ignore next */
            -webkit-box-orient: vertical;
            // padding-bottom: 20px;
          }
          .price {
            padding-top: 20px;
            font-size: 28px;
            font-weight: bold;
            color: #d9011b;
            .symbol {
              margin-right: 5px;
              font-weight: normal;
              font-size: 20px;
            }
          }
        }
        &.disable {
          .outSale {
            visibility: visible;
          }
          .info,
          .price {
            color: #999 !important;
          }
        }
      }
    }
    .empty {
      width: calc(100vw - 20px);
      height: 100%;
    }
    .loadingContent {
      width: calc(100vw - 20px);
      flex-shrink: 0;
    }
  }
}
